# $Id: PKGBUILD 56418 2011-10-07 09:53:30Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=perl-device-modem
pkgver=1.56
pkgrel=1
pkgdesc="Perl extension to talk to modem devices connected via serial port"
arch=('any')
url="http://search.cpan.org/dist/Device-Modem/"
license=('unknown')
depends=('perl-device-serialport')
makedepends=()
provides=('perl-device-modem-log-file=2.10.0' 'perl-device-modem-log-syslog=2.10.0'
	  'perl-device-modem-usrobotics=1.50.0')
options=(!emptydirs)
source=("http://search.cpan.org/CPAN/authors/id/C/CO/COSIMO/Device-Modem-$pkgver.tar.gz")
md5sums=('a0ec45c3e313bea27ccb476d3b725955')

build() {
  _dir=$(find $srcdir -maxdepth 2 -type f -name 'Makefile.PL')
  if [ ! -z "$_dir" ]; then
    cd $(dirname "$_dir")
    PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
    make
    make install DESTDIR="${pkgdir}"
  else
  _dir=$(find $srcdir -maxdepth 2 -type f -name 'Build.PL')
  if [ ! -z "$_dir" ]; then
    cd $(dirname "$_dir")
    PERL_MM_USE_DEFAULT=1 perl Build.PL INSTALLDIRS=vendor
    ./Build
    ./Build install destdir=${pkgdir}
  else
    echo "error: failed to detect build method for $pkgname"
    echo "you may be able to fix this by editing the PKGBUILD"
    return 1
  fi fi
  # remove perllocal.pod and .packlist
  find ${pkgdir} -name perllocal.pod -delete
  find ${pkgdir} -name .packlist -delete
}
